﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace Raider.WinForms.Actions
{
    /// <summary>
    /// Provides event arguments for <see cref="IAction.Executing"/> event handlers.
    /// </summary>
    public class ExecutingEventArgs : CancelEventArgs
    {
        /// <summary/>
        public ExecutingEventArgs()
        {
        }

        /// <summary/>
        public ExecutingEventArgs(bool cancel)
            : base(cancel)
        {
        }

        /// <summary/>
        public ExecutingEventArgs(bool cancel, object argument)
            : this(cancel)
        {
            Argument = argument;
        }

        /// <summary>
        /// Gets the event argument, that will be passed further to 
        /// <see cref="IAction.Execute"/> event (optional).
        /// </summary>
        public object Argument
        {
            get;
            set;
        }

        /// <summary/>
        internal ExecuteEventArgs GetExecuteArgs()
        {
            return new ExecuteEventArgs(Argument);
        }
    }
}
